import request from '@/utils/request'
// 商品分类列表
export function getCategoryList() {
  return request({
    url: '/api/back/shop/commodityKind',
    method: 'get',
    params: { type: 'list', status: 1 }
  })
}
// 顺序设置
export function setCategorySort({ id, sort }) {
  return request({
    url: '/api/back/shop/commodityKind',
    method: 'post',
    data: { id, sort },
    params: { type: 'sort' }
  })
}
// 添加商品分类
export function addOrEditCategoryItem({ id = '', kind_name, higherup, style }) {
  return request({
    url: '/api/back/shop/commodityKind',
    method: 'post',
    data: { id, kind_name, higherup, style },
    params: { type: 'kind', status: 1 }
  })
}
// 删除商品分类
export function deleteCategoryItem(id) {
  return request({
    url: '/api/back/shop/commodityKind',
    method: 'post',
    data: { id },
    params: { type: 'delete' }
  })
}

